
"""configure the application directory"""

import test
import dynamicTree
import whiff.resolver

def get_application(httppath="/"):
    app = whiff.resolver.moduleRootApplication(httppath, test)
    treefinder = dynamicTree.TreeFinder("/")
    app.registerResourceFinder(prefix="tree", finder=treefinder)
    return app

if __name__=="__main__":
    import wsgiref.simple_server
    app = get_application()
    print "autodetect directory tree server"
    print "serving wsgi at 8888"
    print "please start at http://localhost:8888/index"
    srv = wsgiref.simple_server.make_server('localhost', 8888, app)
    srv.serve_forever()
